<%@page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.sql.*" %>
<html>
<head>
    <title>排序查询</title>
    <%! ResultSet rs; %>
    <%

        String dbName = "student";
        String userName = "root";
        String userPassword = "123456";
        String url = "jdbc:mysql://172.21.32.100/" + dbName + "?user=" + userName + "&password=" + userPassword+"&useUnicode=true&characterEncoding=utf-8";
        Connection conn = DriverManager.getConnection(url);
        Statement statement = conn.createStatement();


    %>
</head>
<body>
<table border="1">
    <th colspan="7" style=" font-size: x-large; alignment: center">学生信息表</th>
        <tr style=" text-align: center">
            <td>学号</td>
            <td>姓名</td>
            <td>性别</td>
            <td>政治身份</td>
            <td>出生日期</td>
            <td>身份证号</td>
            <td>所在系部</td>
        </tr>
            <% while (rs.next()) { %>
        <tr style=" text-align: center">
            <td><%= rs.getString(1) %></td>
            <td><%= rs.getString(2) %></td>
            <td><%= rs.getString(3) %></td>
            <td><%= rs.getString("stu_politicalstatus") %></td>
            <td><%= rs.getString("stu_birthday") %></td>
            <td><%= rs.getString("stu_identitycard") %></td>
            <td><%= rs.getString("stu_speciality") %></td>
            <tr/>
        <% } %>
        <%
            rs.close();
            statement.close();
            conn.close();
        %>
</table></body></html>
